package oop.ex1.actions;

import java.io.File;


/**
 * a sub class that prints the file's name.	
 * @author danalmog
 * @author danielshalev
 */
public class PrintName extends Actions {

	String fileName;
	
	/**
	 * constructs a new objects and saves the file name in a local field
	 * @param file the file which is name we want to print
	 */
	public PrintName(File file){
		super(file);
		this.fileName = new String(file.getName());
	}
	
	/**
	 * prints the file name
	 */
	public void doAction(){
		System.out.println(fileName);
	}
		
}
